From 63f8f999b560184176fc7446a5d94e308c5d939d Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 11 Apr 2010 22:43:33 +0000 Subject: [PATCH] Improve error messages in trackfilter for bad data. Try to provide some context. --- trackfilter.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/trackfilter.c b/trackfilter.c index 2ea676e44..118425b6b 100644 --- a/trackfilter.c +++ b/trackfilter.c @@ -40,6 +40,7 @@ #include "filterdefs.h" #include "strptime.h" #include "grtcirc.h" +#include "xmlgeneric.h" #if FILTERS_ENABLED #define MYNAME "trackfilter" @@ -266,8 +267,10 @@ trackfilter_fill_track_list_cb(const route_head *track) /* callback for track_d track_pts++; wpt = (waypoint *)elem; - is_fatal((need_time != 0) && (wpt->creation_time == 0), - MYNAME "-init: Found track point without time!"); + if((need_time != 0) && (wpt->creation_time == 0)) { + fatal(MYNAME "-init: Found track point at %f,%f without time!\n", + wpt->latitude, wpt->longitude); + } i++; if (i == 1) @@ -278,8 +281,12 @@ trackfilter_fill_track_list_cb(const route_head *track) /* callback for track_d if ((need_time != 0) && (prev != NULL) && (prev->creation_time > wpt->creation_time)) { - if (opt_merge == NULL) - fatal(MYNAME "-init: Track points badly ordered (timestamp)!\n"); + if (opt_merge == NULL) { + char t1[64], t2[64]; + xml_fill_in_time(t1, prev->creation_time, 0, XML_LONG_TIME); + xml_fill_in_time(t2, wpt->creation_time, 0, XML_LONG_TIME); + fatal(MYNAME "-init: Track points badly ordered (timestamp %s > %s)!\n", t1, t2); + } } prev = wpt; } -- 2.30.2